﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;

namespace MDCAdminTool.Commands
{
    public class GetObjectsInRegion : AsyncCommandBindingBase
    {
        public GetObjectsInRegion() : base()
        {
            Command = Application.Current.Resources["GetObjectsInRegion"] as ICommand;
        }

        protected override void OnExecuted( object sender , ExecutedRoutedEventArgs e )
        {
            var cr = e.Parameter as CacheRegion;
            
            if( cr == null ) return;

            var cache = cr.Parent as MdcCache;

            if( cache == null ) return;

            
            var client = CacheClientFactory.GetCache( cache );
            var result = client.GetObjectsInRegion(cr.Name);
        }
    }
}
